<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>windows - RDoc Documentation</title>


<script src="./js/navigation.js" defer></script>
<script src="./js/search.js" defer></script>
<script src="./js/search_index.js" defer></script>
<script src="./js/searcher.js" defer></script>
<script src="./js/darkfish.js" defer></script>

<script src="./js/jquery-3.2.0.min.js"></script>

<script src="./js/vue.min.js"></script>
<script src="./js/js.cookie.min.js"></script>

<link href="./css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="./css/rdoc.css" rel="stylesheet">
<link href="./css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
  var index_rel_prefix = "./";
  var darkModeCsseHref = "./css/rdoc-dm.css"
  var defaultModeCssHref = "./css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="file">
  <!-- this is page.html -->
  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0-preview2 NOT FOUND -->
  </div> <!-- end action bar -->


 <div class='wrapper hdiv'>

 


<nav id='vapp' role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="./index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="./table_of_contents.html#pages">Pages</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  
<div class="nav-section">
  <h3>Table of Contents</h3>

  <ul class="link-list" role="directory">
    <li><a href="#label-Windows">Windows</a>
    <li><a href="#label-Building+Ruby+using+Mingw+with+UCRT">Building Ruby using Mingw with UCRT</a>
    <li><a href="#label-Build+examples">Build examples</a>
    <li><a href="#label-Building+Ruby+using+Visual+C-2B-2B">Building Ruby using Visual C++</a>
    <li><a href="#label-Requirement">Requirement</a>
    <li><a href="#label-How+to+compile+and+install">How to compile and install</a>
    <li><a href="#label-Build+examples">Build examples</a>
    <li><a href="#label-Bugs">Bugs</a>
    <li><a href="#label-Icons">Icons</a>
  </ul>
</div>

  <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>

  <div id="project-metadata">
   <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
    
<div id="fileindex-section" class="nav-section">
  <h3>Pages</h3>

  <ul class="link-list">
    <li><a href="./NEWS/NEWS-1_8_7.html">NEWS-1.8.7</a>
    <li><a href="./NEWS/NEWS-1_9_1.html">NEWS-1.9.1</a>
    <li><a href="./NEWS/NEWS-1_9_2.html">NEWS-1.9.2</a>
    <li><a href="./NEWS/NEWS-1_9_3.html">NEWS-1.9.3</a>
    <li><a href="./NEWS/NEWS-2_0_0.html">NEWS-2.0.0</a>
    <li><a href="./NEWS/NEWS-2_1_0.html">NEWS-2.1.0</a>
    <li><a href="./NEWS/NEWS-2_2_0.html">NEWS-2.2.0</a>
    <li><a href="./NEWS/NEWS-2_3_0.html">NEWS-2.3.0</a>
    <li><a href="./NEWS/NEWS-2_4_0.html">NEWS-2.4.0</a>
    <li><a href="./NEWS/NEWS-2_5_0.html">NEWS-2.5.0</a>
    <li><a href="./NEWS/NEWS-2_6_0.html">NEWS-2.6.0</a>
    <li><a href="./NEWS/NEWS-2_7_0.html">NEWS-2.7.0</a>
    <li><a href="./NEWS/NEWS-3_0_0_md.html">NEWS-3.0.0</a>
    <li><a href="./NEWS/NEWS-3_1_0_md.html">NEWS-3.1.0</a>
    <li><a href="./NEWS/NEWS-3_2_0_md.html">NEWS-3.2.0</a>
    <li><a href="./bsearch_rdoc.html">bsearch</a>
    <li><a href="./bug_triaging_rdoc.html">bug_triaging</a>
    <li><a href="./case_mapping_rdoc.html">case_mapping</a>
    <li><a href="./character_selectors_rdoc.html">character_selectors</a>
    <li><a href="./command_injection_rdoc.html">command_injection</a>
    <li><a href="./contributing_md.html">contributing</a>
    <li><a href="./contributing/building_ruby_md.html">building_ruby</a>
    <li><a href="./contributing/documentation_guide_md.html">documentation_guide</a>
    <li><a href="./contributing/glossary_md.html">glossary</a>
    <li><a href="./contributing/making_changes_to_ruby_md.html">making_changes_to_ruby</a>
    <li><a href="./contributing/making_changes_to_stdlibs_md.html">making_changes_to_stdlibs</a>
    <li><a href="./contributing/reporting_issues_md.html">reporting_issues</a>
    <li><a href="./contributing/testing_ruby_md.html">testing_ruby</a>
    <li><a href="./dig_methods_rdoc.html">dig_methods</a>
    <li><a href="./distribution_md.html">distribution</a>
    <li><a href="./dtrace_probes_rdoc.html">dtrace_probes</a>
    <li><a href="./encodings_rdoc.html">encodings</a>
    <li><a href="./extension_ja_rdoc.html">extension.ja</a>
    <li><a href="./extension_rdoc.html">extension</a>
    <li><a href="./fiber_md.html">fiber</a>
    <li><a href="./format_specifications_rdoc.html">format_specifications</a>
    <li><a href="./globals_rdoc.html">globals</a>
    <li><a href="./implicit_conversion_rdoc.html">implicit_conversion</a>
    <li><a href="./keywords_rdoc.html">keywords</a>
    <li><a href="./maintainers_md.html">maintainers</a>
    <li><a href="./marshal_rdoc.html">marshal</a>
    <li><a href="./memory_view_md.html">memory_view</a>
    <li><a href="./optparse/argument_converters_rdoc.html">argument_converters</a>
    <li><a href="./optparse/creates_option_rdoc.html">creates_option</a>
    <li><a href="./optparse/option_params_rdoc.html">option_params</a>
    <li><a href="./optparse/tutorial_rdoc.html">tutorial</a>
    <li><a href="./packed_data_rdoc.html">packed_data</a>
    <li><a href="./ractor_md.html">ractor</a>
    <li><a href="./regexp_rdoc.html">regexp</a>
    <li><a href="./regexp/methods_rdoc.html">methods</a>
    <li><a href="./regexp/unicode_properties_rdoc.html">unicode_properties</a>
    <li><a href="./ruby_3_3_0_preview2/COPYING.html">COPYING</a>
    <li><a href="./ruby_3_3_0_preview2/COPYING_ja.html">COPYING.ja</a>
    <li><a href="./ruby_3_3_0_preview2/LEGAL.html">LEGAL</a>
    <li><a href="./ruby_3_3_0_preview2/NEWS_md.html">NEWS</a>
    <li><a href="./ruby_3_3_0_preview2/README_ja_md.html">README.ja</a>
    <li><a href="./ruby_3_3_0_preview2/README_md.html">README</a>
    <li><a href="./security_rdoc.html">security</a>
    <li><a href="./signals_rdoc.html">signals</a>
    <li><a href="./standard_library_rdoc.html">standard_library</a>
    <li><a href="./strftime_formatting_rdoc.html">strftime_formatting</a>
    <li><a href="./syntax_rdoc.html">syntax</a>
    <li><a href="./syntax/assignment_rdoc.html">assignment</a>
    <li><a href="./syntax/calling_methods_rdoc.html">calling_methods</a>
    <li><a href="./syntax/comments_rdoc.html">comments</a>
    <li><a href="./syntax/control_expressions_rdoc.html">control_expressions</a>
    <li><a href="./syntax/exceptions_rdoc.html">exceptions</a>
    <li><a href="./syntax/literals_rdoc.html">literals</a>
    <li><a href="./syntax/methods_rdoc.html">methods</a>
    <li><a href="./syntax/miscellaneous_rdoc.html">miscellaneous</a>
    <li><a href="./syntax/modules_and_classes_rdoc.html">modules_and_classes</a>
    <li><a href="./syntax/pattern_matching_rdoc.html">pattern_matching</a>
    <li><a href="./syntax/precedence_rdoc.html">precedence</a>
    <li><a href="./syntax/refinements_rdoc.html">refinements</a>
    <li><a href="./timezones_rdoc.html">timezones</a>
    <li><a href="./windows_md.html">windows</a>
    <li><a href="./yjit/yjit_md.html">yjit</a>
    <li><a href="./yjit/yjit_hacking_md.html">yjit_hacking</a>
  </ul>
</div>

   </div>
  </div>
</nav>


<!--  carbon ads here -->

<div id='extraz'>
  <div class='adzbox-index'  >
   
  </div>
 </div>         


<main role="main" aria-label="Page windows.md">

<h1 id="label-Windows">Windows<span><a href="#label-Windows">&para;</a> <a href="#top">&uarr;</a></span></h1>

<p>Ruby supports a few native build platforms for Windows.</p>
<ul><li>
<p>mswin: Build using Microsoft Visual C++ compiler</p>
</li><li>
<p>mingw-msvcrt: Build using compiler for Mingw with msvcrtXX.dll</p>
</li><li>
<p>mingw-ucrt: Build using compiler for Mingw with vcruntime.dll</p>
</li></ul>

<h2 id="label-Building+Ruby+using+Mingw+with+UCRT">Building Ruby using Mingw with UCRT<span><a href="#label-Building+Ruby+using+Mingw+with+UCRT">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>The easiest build environment is just a standard <a href="https://rubyinstaller.org/">RubyInstaller-Devkit</a> installation and <a href="https://gitforwindows.org/">git-for-windows</a>. You might like to use <a href="https://code.visualstudio.com/">VSCode</a> as an editor.</p>

<h3 id="label-Build+examples">Build examples<span><a href="#label-Build+examples">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>Ruby core development can be done either in Windows <code>cmd</code> like:</p>

<pre>ridk enable ucrt64

pacman -S --needed %MINGW_PACKAGE_PREFIX%-openssl %MINGW_PACKAGE_PREFIX%-libyaml

cd c:\
mkdir work
cd work
git clone https://github.com/ruby/ruby

cd c:\work\ruby
sh autogen.sh
sh configure  -C --disable-install-doc
make</pre>

<p>or in MSYS2 <code>bash</code> like:</p>

<pre>ridk enable ucrt64
bash

pacman -S --needed $MINGW_PACKAGE_PREFIX-openssl $MINGW_PACKAGE_PREFIX-libyaml

cd /c/
mkdir work
cd work
git clone https://github.com/ruby/ruby
cd ruby

./autogen.sh
./configure -C --disable-install-doc
make</pre>

<h2 id="label-Building+Ruby+using+Visual+C-2B-2B">Building Ruby using Visual C++<span><a href="#label-Building+Ruby+using+Visual+C-2B-2B">&para;</a> <a href="#top">&uarr;</a></span></h2>

<h3 id="label-Requirement">Requirement<span><a href="#label-Requirement">&para;</a> <a href="#top">&uarr;</a></span></h3>
<ol><li>
<p>Windows 7 or later.</p>
</li><li>
<p>Visual C++ 12.0 (2013) or later.</p>

<p><strong>Note</strong> if you want to build x64 version, use native compiler for x64.</p>
</li><li>
<p>Please set environment variable <code>INCLUDE</code>, <code>LIB</code>, <code>PATH</code> to run required commands properly from the command line.</p>

<p><strong>Note</strong> building ruby requires following commands.</p>
<ul><li>
<p>nmake</p>
</li><li>
<p>cl</p>
</li><li>
<p>ml</p>
</li><li>
<p>lib</p>
</li><li>
<p>dumpbin</p>
</li></ul>
</li><li>
<p>If you want to build from GIT source, following commands are required.</p>
<ul><li>
<p>patch</p>
</li><li>
<p>sed</p>
</li><li>
<p>ruby 2.0 or later</p>
</li></ul>

<p>You can use <a href="https://scoop.sh/">scoop</a> to install them like:</p>

<pre class="ruby"><span class="ruby-identifier">scoop</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">git</span> <span class="ruby-identifier">ruby</span> <span class="ruby-identifier">sed</span> <span class="ruby-identifier">patch</span>
</pre>
</li><li>
<p>You need to install required libraries using <a href="https://vcpkg.io/">vcpkg</a> like:</p>

<pre>vcpkg --triplet x64-windows install openssl libffi libyaml zlib</pre>
</li><li>
<p>Enable Command Extension of your command line. It's the default behavior of <code>cmd.exe</code>. If you want to enable it explicitly, run <code>cmd.exe</code> with <code>/E:ON</code> option.</p>
</li></ol>

<h3 id="label-How+to+compile+and+install">How to compile and install<span><a href="#label-How+to+compile+and+install">&para;</a> <a href="#top">&uarr;</a></span></h3>
<ol><li>
<p>Execute <code>win32\configure.bat</code> on your build directory. You can specify the target platform as an argument. For example, run <code>configure --target=i686-mswin32</code> You can also specify the install directory. For example, run <code>configure --prefix=&lt;install_directory&gt;</code> Default of the install directory is <code>/usr</code> . The default <em>PLATFORM</em> is <code>i386-mswin32_</code><em>MSRTVERSION</em> on 32-bit platforms, or <code>x64-mswin64_</code><em>MSRTVERSION</em> on x64 platforms. <em>MSRTVERSION</em> is the 2- or 3-digits version of the Microsoft Runtime Library.</p>
</li><li>
<p>Change <em>RUBY_INSTALL_NAME</em> and <em>RUBY_SO_NAME</em> in <code>Makefile</code> if you want to change the name of the executable files. And add <em>RUBYW_INSTALL_NAME</em> to change the name of the executable without console window if also you want.</p>
</li><li>
<p>You need specify vcpkg directory to use <code>--with-opt-dir</code> option like <code>configure --with-opt-dir=C:\vcpkg\installed\x64-windows</code></p>
</li><li>
<p>Run <code>nmake up</code> if you are building from GIT source.</p>
</li><li>
<p>Run <code>nmake</code></p>
</li><li>
<p>Run <code>nmake check</code></p>
</li><li>
<p>Run <code>nmake install</code></p>
</li></ol>

<h3 id="label-Build+examples">Build examples<span><a href="#label-Build+examples">&para;</a> <a href="#top">&uarr;</a></span></h3>
<ul><li>
<p>Build on the ruby source directory.</p>

<pre>ruby source directory:  C:\ruby
build directory:        C:\ruby
install directory:      C:\usr\local</pre>

<pre>C:
cd \ruby
win32\configure --prefix=/usr/local
nmake
nmake check
nmake install</pre>
</li><li>
<p>Build on the relative directory from the ruby source directory.</p>

<pre>ruby source directory:  C:\ruby
build directory:        C:\ruby\mswin32
install directory:      C:\usr\local</pre>

<pre>C:
cd \ruby
mkdir mswin32
cd mswin32
..\win32\configure --prefix=/usr/local
nmake
nmake check
nmake install</pre>
</li><li>
<p>Build on the different drive.</p>

<pre>ruby source directory:  C:\src\ruby
build directory:        D:\build\ruby
install directory:      C:\usr\local</pre>

<pre>D:
cd D:\build\ruby
C:\src\ruby\win32\configure --prefix=/usr/local
nmake
nmake check
nmake install DESTDIR=C:</pre>
</li><li>
<p>Build x64 version (requires native x64 VC++ compiler)</p>

<pre>ruby source directory:  C:\ruby
build directory:        C:\ruby
install directory:      C:\usr\local</pre>

<pre>C:
cd \ruby
win32\configure --prefix=/usr/local --target=x64-mswin64
nmake
nmake check
nmake install</pre>
</li></ul>

<h3 id="label-Bugs">Bugs<span><a href="#label-Bugs">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>You can <strong>NOT</strong> use a path name that contains any white space characters as the ruby source directory, this restriction comes from the behavior of <code>!INCLUDE</code> directives of <code>NMAKE</code>.</p>

<p>You can build ruby in any directory including the source directory, except <code>win32</code> directory in the source directory. This is restriction originating in the path search method of <code>NMAKE</code>.</p>

<h2 id="label-Icons">Icons<span><a href="#label-Icons">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Any icon files(<code>*.ico</code>) in the build directory, directories specified with <em>icondirs</em> make variable and <code>win32</code> directory under the ruby source directory will be included in DLL or executable files, according to their base names.  $(RUBY_INSTALL_NAME).ico or ruby.ico –&gt; $(RUBY_INSTALL_NAME).exe  $(RUBYW_INSTALL_NAME).ico or rubyw.ico –&gt; $(RUBYW_INSTALL_NAME).exe  the others –&gt; $(RUBY_SO_NAME).dll</p>

<p>Although no icons are distributed with the ruby source, you can use anything you like. You will be able to find many images by search engines. For example, followings are made from <a href="https://cache.ruby-lang.org/pub/misc/logo/ruby-logo-kit.zip">Ruby logo kit</a>:</p>
<ul><li>
<p>Small <a href="https://www.ruby-lang.org/favicon.ico">favicon</a> in the official site</p>
</li><li>
<p><a href="http://ruby.morphball.net/vit-ruby-ico_en.html">vit-ruby.ico</a> or <a href="http://ruby.morphball.net/icon/vit-ruby.ico">icon itself</a></p>
</li></ul>

</main>

</div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

